<?php

namespace api\controller;

// +----------------------------------------------------------------------
// | 控件数据控制层
// +----------------------------------------------------------------------

use common\service\DingAttendanceService;
use think\Controller;
use think\Request;

class DingAttendanceController extends Controller
{

    private $dingAttendanceService;

    public function __construct()
    {
        parent::__construct();
        $this->dingAttendanceService = DingAttendanceService::getInstance();
    }

    /**
     * 考勤记录 (打卡,补卡时调用)
     * @param Request $request
     * @return \think\Response
     */
    public function checkAttendance(Request $request)
    {
        $data = $request->param()['data'];
        $res = $this->dingAttendanceService->checkAttendance($data);
        return json(success_response('ok', $res));
    }
}
